Перейти к основному содержимому

Reseller Create User API

POST /resellerCreateUser

Description

This API endpoint allows a reseller to create a new user within their assigned group by providing user details such as email, password, group ID, personal information, and access settings.

Request Body

The request utilizes GraphQL to perform the resellerCreateUser mutation.

Mutation:

mutation resellerCreateUser ($user: ResellerUserCreate) {
resellerCreateUser (user: $user) {
id
email
username
resellerId
role
enabled
radAccess
radAccessClear
createdAt
updatedAt
}
}

Variables:

{
"user": {
"email": "<User_Email>",
"password": "<User_Password>",
"groupId": 0,
"firstName": "<First_Name>",
"lastName": "<Last_Name>",
"userName": "<Username>",
"country": "<Country>",
"phone": "<Phone_Number>",
"lang": "<Language_Code>",
"devices": 0,
"login": 0
}
}
  • user (ResellerUserCreate Object): An object containing the new user's details.
    • email (String): The email address of the user.
    • password (String): The password for the user's account.
    • groupId (Int): The ID of the group the user will belong to.
    • firstName (String): The first name of the user.
    • lastName (String): The last name of the user.
    • userName (String): The username for the user.
    • country (String): The country where the user is located.
    • phone (String): The phone number of the user.
    • lang (String): The language code for the user's preferred language.
    • devices (Int): The number of devices the user can connect.
    • login (Int): The number of simultaneous logins allowed for the user.

Response:

  • Success (200 OK):

    • If the user creation is successful, the response will return the details of the newly created user, including their ID, email, username, and other attributes.
    {
    "data": {
    "resellerCreateUser": {
    "id": "<User_ID>",
    "email": "<User_Email>",
    "username": "<Username>",
    "resellerId": "<Reseller_ID>",
    "role": "<User_Role>",
    "enabled": "<Enabled_Status>",
    "radAccess": "<Rad_Access>",
    "radAccessClear": "<Rad_Access_Clear>",
    "createdAt": "<Creation_Timestamp>",
    "updatedAt": "<Update_Timestamp>"
    }
    }
    }
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid data, missing required fields, or server errors.

Note:

Ensure that all required fields for the user object are provided and correctly formatted according to the platform's specifications. This API should be used by resellers with the necessary permissions to create and manage user accounts within their assigned groups.